<html>
<body>
<?php
require ("connection.php");
if (isset($_REQUEST['x'])) {
    $x = $_REQUEST['x'];

    echo "<form method='post' action='A_D_Magazine.php?x=$x'>";
    echo "<h2>Are you sure you want to delete this Magazine?</h2><br>";
    echo "<input type='radio' name='check' value='" . $x . "'>Delete";
    echo "<input type='radio' name='check' value='no'>Not Delete";
    echo "<input type='submit' name='submit' value='Submit'>";
    echo "</form>";
}
if (isset($_POST['submit'])) {
    if ($_POST["check"] != "No") {
        $url = $_POST["check"];
        $dquery = "DELETE FROM Magazine_photo WHERE Mag_id='$url'";
        mysql_query($dquery);
        $dmquery = "DELETE FROM Magazine WHERE Magazine_id='$url'";
        mysql_query($dmquery);

    }
    header("Location: Admin_Magazine.php");
}
?>
</body>
</html>